﻿CKEDITOR.plugins.add('openCkFinder', {
    init: function (editor) {
        var pluginName = 'openCkFinder';
       // CKEDITOR.dialog.add(pluginName, this.path + 'dialogs/openCkFinder.js');
       // editor.addCommand(pluginName, new CKEDITOR.dialogCommand(pluginName));
        editor.ui.addButton(pluginName,
        {
            label: '选图',
            command: pluginName
        });
        editor.addCommand(pluginName, {
            exec: function (e) {
                if (this.state == CKEDITOR.TRISTATE_ON) this.setState(CKEDITOR.TRISTATE_OFF);
                else this.setState(CKEDITOR.TRISTATE_ON);
                parent.buildCkFinder(this.state);
                try { openCkFinder_click(this.state); } catch (e) { }
            }
        });

    }
});